package com.ruoyi.notice.service.impl;

import com.ruoyi.notice.domain.mgNotice;
import com.ruoyi.notice.mapper.mgNoticeMapper;
import com.ruoyi.notice.service.mgNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Classname mgNoticeServiceImpl
 * @Description
 * @Date 2025/5/24 14:39
 * @Created by FINE
 */
@Service
public class mgNoticeServiceImpl implements mgNoticeService {
    @Autowired
    private mgNoticeMapper mgnoticeMapper;
    @Override
    public void insert(mgNotice notice) {
          mgnoticeMapper.insert(notice);
    }

    @Override
    public void delete(String id) {
        mgnoticeMapper.deleteById(id);
    }

    @Override
    public void update(mgNotice notice) {
        mgnoticeMapper.save(notice);
    }

    @Override
    public List<mgNotice> list() {
        return mgnoticeMapper.findAll();
    }

    @Override
    public mgNotice getById(String id) {
        return mgnoticeMapper.findById(id).orElse(new mgNotice());
    }
}